

%include "typemaps.i"


// Handles the input types
%typemap(in) ::google::protobuf::int32
{
   $1 = (::google::protobuf::int32) PyLong_AsLong($input);
}

%typemap(in) ::google::protobuf::uint32
{
   $1 = (::google::protobuf::uint32) PyLong_AsUnsignedLong($input);
}

%typemap(in) ::google::protobuf::int64
{
   $1 = (::google::protobuf::int64) PyLong_AsLongLong($input);
}

%typemap(in) ::google::protobuf::uint64
{
   $1 = (::google::protobuf::uint64) PyLong_AsUnsignedLongLong($input);
}





// Handles the return types




%typemap(out) ::std::string
{
   $result = PyUnicode_FromStringAndSize(($1).c_str(), (Py_ssize_t)(($1).length()));
}
 
%typemap(out) const ::std::string&
{
   $result = PyUnicode_FromStringAndSize(($1).c_str(), (Py_ssize_t)(($1).length()));
}
 
%typemap(out) ::std::string *
{
   $result = PyUnicode_FromStringAndSize(($1)->c_str(), (Py_ssize_t)(($1)->length()));
}

